package jp.aist.gtrc.plus.admission.EDF;

import java.util.*;

public class DeadlineComparator implements Comparator {
   public int compare(Object o1, Object o2) {
      Job j1 = (Job) o1;
      Job j2 = (Job) o2;
      int diff = 0;
      if (j1.deadline < j2.deadline) 
         diff = -1;
      else if (j1.deadline > j2.deadline) 
         diff = 1;
      if (diff == 0) {
         diff = j1.id - j2.id;
      }
      return diff;
   }

}
